Retrieve a scalar
The PersistenceManager class has a method ExecuteScalar to retrieve a scalar from the database:
OleDbCommand cmd = new OleDbCommand( String.Format("select [{0}] from [{1}] where [{2}] = 1", Employee.ColumnNames.LastName, Employee.TableName, Employee.ColumnNames.EmployeeId)); String lastName = (string)PersistenceManager.ExecuteScalar(cmd); |